package com.janella.web.beans;

import java.util.List;

import com.janella.dao.UserDAO;
import com.janella.model.User;

public class UserPageController {
	
	private UserDAO userDAO;
	private User user;
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public void setUserDAO(UserDAO userDAO){
		this.userDAO = userDAO;
	}
	
	public List<User> getUsers(){
		return userDAO.getUsers();
	}
	
	public String addUser(){
		user = new User();
		return "ok";
	}
	
	public String save(){
		userDAO.addUser(user);
		user = null;
		return "ok";
	}
	
}
